# 使用列表的一部分
players = ['charles', 'martina', 'michael', 'florence', 'eli']
print(players[0:3])

# 复制列表
my_foods = ['pizza', 'falafel', 'carrot cake']
friend_foods = my_foods[:]
print("My favorite foods are:")
print(my_foods)
print("\nMy friend's favorite foods are:")
print(friend_foods)

# 打印消息“The first three items in the list are:”，再使用切片来打印列表的前三个元素
players_1 = players[:3]
print('The first three items in the list are:')
for player in players_1:
    print(player)

# 打印消息“Three items from the middle of the list are:”，再使用切片来打印列表中间的三个元素
players_2 = players[1:4]
print('Three items from the middle of the list are:')
for player in players_2:
    print(player)

# 打印消息“The last three items in the list are:”，再使用切片来打印列表末尾的三个元素
players_3 = players[2:]
print('The last three items in the list are:')
for player in players_3:
    print(player)

#
pizzas = ['pizza', 'falafel', 'carrot cake']
friend_pizza = pizzas[:]
pizzas.append('pisa')
friend_pizza.append('pisa1')
print('My favorite foods are:')
print(pizzas)
print("My friend's favorite pizzas are:")
print(friend_pizza)
